package com.wang.controller;

import com.wang.entity.Student;
import com.wang.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Classname StudentController
 * @Description TODO
 * @Date 2024/5/15 12:13
 * @Created by pc
 */
@RestController
public class StudentController {
    @Autowired
    private StudentService studentService;

    @RequestMapping("/find")
    public List<Student> find(@RequestParam(value = "pageNum",required = false,defaultValue = "1") Integer pageNum,
                              @RequestParam(value = "pageSize",required = false,defaultValue = "1")Integer pageSize){
        return studentService.getAll(pageNum,pageSize);
    }
}
